package sv.gob.mh.dgii.model;

// Generated Dec 12, 2007 3:08:52 PM by Hibernate Tools 3.2.0.CR1

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * TbDepartamento generated by hbm2java
 */
@Entity
@Table(name = "TB_DEPARTAMENTO", schema = "CATALOGOS")
public class TbDepartamento implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String cdepartamento;
	private String cusuario;
	private String ddepartamento;
	private String czonaGeo;
	private Integer bdesplegable;
	private Integer bstatus;
	private Date fhingreso;
	private Set<TbMunicipio> tbMunicipios = new HashSet<TbMunicipio>(0);

	public TbDepartamento() {
	}

	public TbDepartamento(String cdepartamento, String cusuario,
			String ddepartamento, String czonaGeo, Integer bdesplegable,
			Integer bstatus) {
		this.cdepartamento = cdepartamento;
		this.cusuario = cusuario;
		this.ddepartamento = ddepartamento;
		this.czonaGeo = czonaGeo;
		this.bdesplegable = bdesplegable;
		this.bstatus = bstatus;
	}

	public TbDepartamento(String cdepartamento, String cusuario,
			String ddepartamento, String czonaGeo, Integer bdesplegable,
			Integer bstatus, Date fhingreso, Set<TbMunicipio> tbMunicipios) {
		this.cdepartamento = cdepartamento;
		this.cusuario = cusuario;
		this.ddepartamento = ddepartamento;
		this.czonaGeo = czonaGeo;
		this.bdesplegable = bdesplegable;
		this.bstatus = bstatus;
		this.fhingreso = fhingreso;
		this.tbMunicipios = tbMunicipios;
	}

	@Id
	@Column(name = "C_DEPARTAMENTO", unique = true, nullable = false, length = 2)
	public String getCdepartamento() {
		return this.cdepartamento;
	}

	public void setCdepartamento(String cdepartamento) {
		this.cdepartamento = cdepartamento;
	}

	@Column(name = "C_USUARIO", nullable = false, length = 30)
	public String getCusuario() {
		return this.cusuario;
	}

	public void setCusuario(String cusuario) {
		this.cusuario = cusuario;
	}

	@Column(name = "D_DEPARTAMENTO", nullable = false, length = 12)
	public String getDdepartamento() {
		return this.ddepartamento;
	}

	public void setDdepartamento(String ddepartamento) {
		this.ddepartamento = ddepartamento;
	}

	@Column(name = "C_ZONA_GEO", nullable = false, length = 1)
	public String getCzonaGeo() {
		return this.czonaGeo;
	}

	public void setCzonaGeo(String czonaGeo) {
		this.czonaGeo = czonaGeo;
	}

	@Column(name = "B_DESPLEGABLE", nullable = false, precision = 1, scale = 0)
	public Integer getBdesplegable() {
		return this.bdesplegable;
	}

	public void setBdesplegable(Integer bdesplegable) {
		this.bdesplegable = bdesplegable;
	}

	@Column(name = "B_STATUS", nullable = false, precision = 1, scale = 0)
	public Integer getBstatus() {
		return this.bstatus;
	}

	public void setBstatus(Integer bstatus) {
		this.bstatus = bstatus;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "FH_INGRESO", length = 7)
	public Date getFhingreso() {
		return this.fhingreso;
	}

	public void setFhingreso(Date fhingreso) {
		this.fhingreso = fhingreso;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbDepartamento")
	public Set<TbMunicipio> getTbMunicipios() {
		return this.tbMunicipios;
	}

	public void setTbMunicipios(Set<TbMunicipio> tbMunicipios) {
		this.tbMunicipios = tbMunicipios;
	}

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 29 * hash + (this.cdepartamento != null ? this.cdepartamento.hashCode() : 0);
        hash = 29 * hash + (this.cusuario != null ? this.cusuario.hashCode() : 0);
        hash = 29 * hash + (this.ddepartamento != null ? this.ddepartamento.hashCode() : 0);
        hash = 29 * hash + (this.czonaGeo != null ? this.czonaGeo.hashCode() : 0);
        hash = 29 * hash + (this.bdesplegable != null ? this.bdesplegable.hashCode() : 0);
        hash = 29 * hash + (this.bstatus != null ? this.bstatus.hashCode() : 0);
        hash = 29 * hash + (this.fhingreso != null ? this.fhingreso.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final TbDepartamento other = (TbDepartamento) obj;
        if ((this.cdepartamento == null) ? (other.cdepartamento != null) : !this.cdepartamento.equals(other.cdepartamento)) {
            return false;
        }
        if ((this.cusuario == null) ? (other.cusuario != null) : !this.cusuario.equals(other.cusuario)) {
            return false;
        }
        if ((this.ddepartamento == null) ? (other.ddepartamento != null) : !this.ddepartamento.equals(other.ddepartamento)) {
            return false;
        }
        if ((this.czonaGeo == null) ? (other.czonaGeo != null) : !this.czonaGeo.equals(other.czonaGeo)) {
            return false;
        }
        if (this.bdesplegable != other.bdesplegable && (this.bdesplegable == null || !this.bdesplegable.equals(other.bdesplegable))) {
            return false;
        }
        if (this.bstatus != other.bstatus && (this.bstatus == null || !this.bstatus.equals(other.bstatus))) {
            return false;
        }
        if (this.fhingreso != other.fhingreso && (this.fhingreso == null || !this.fhingreso.equals(other.fhingreso))) {
            return false;
        }
        return true;
    }

        
    
    @Override
    public String toString() {
        return "TbDepartamento{" + "cdepartamento=" + cdepartamento + ", cusuario=" + cusuario + ", ddepartamento=" + ddepartamento + ", czonaGeo=" + czonaGeo + ", bdesplegable=" + bdesplegable + ", bstatus=" + bstatus + ", fhingreso=" + fhingreso + '}';
    }

    
        

}
